﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Display.TrainUI {
    import flash.display.*;
    import Classes.*;
    import Display.*;
    import flash.text.*;
    import L10n.*;

    public class TrainStopTooltip extends Sprite {

        private var m_background:DisplayObject;
        private var m_beak:DisplayObject;
        private var m_tfTitle:TextField;
        private var m_titleFormat:TextFormat;

        public function TrainStopTooltip(){
            this.mouseChildren = (this.mouseEnabled = false);
            this.m_background = (new EmbeddedArt.mkt_category_bubble() as DisplayObject);
            addChild(this.m_background);
            this.m_beak = (new EmbeddedArt.mkt_category_beak() as DisplayObject);
            addChild(this.m_beak);
            this.m_titleFormat = new TextFormat(EmbeddedArt.TITLE_FONT, 16, 4759807);
            this.m_tfTitle = new TextField();
            this.m_tfTitle.embedFonts = true;
            this.m_tfTitle.antiAliasType = AntiAliasType.ADVANCED;
            this.m_tfTitle.autoSize = TextFieldAutoSize.LEFT;
            this.m_tfTitle.defaultTextFormat = this.m_titleFormat;
            addChild(this.m_tfTitle);
        }
        public function changeInfo(_arg1:String):void{
            this.m_tfTitle.text = _arg1;
            TextFieldUtil.formatSmallCaps(this.m_tfTitle, new TextFormat(EmbeddedArt.TITLE_FONT, 20));
            LocaleHelper.localSetting.TextField_adjust(this.m_tfTitle, {
                embedFonts:false,
                font:EmbeddedArt.SYSTEM_FONT,
                bold:true,
                size:18
            });
            this.draw();
        }
        protected function draw():void{
            this.m_background.width = (this.m_tfTitle.width + 20);
            this.m_background.height = (this.m_tfTitle.height + 5);
            this.m_beak.y = (this.m_background.height - 6);
            this.m_beak.x = ((this.m_background.width * 0.5) - (this.m_beak.width * 0.5));
            this.m_tfTitle.x = ((this.m_background.width * 0.5) - (this.m_tfTitle.width * 0.5));
        }

    }
}//package Display.TrainUI 
